home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-08-12 | 16.4 KB | 531 lines | [TEXT/MPS ] |
- ;
- ; File: QD3DView.a
- ;
- ; Contains: View types and routines
- ;
- ; Version: Technology: Quickdraw 3D 1.5.1
- ; Release: Universal Interfaces 3.0.1
- ;
- ; Copyright: © 1995-1997 by Apple Computer, Inc., all rights reserved.
- ;
- ; Bugs?: Please include the the file and version information (from above) with
- ; the problem description. Developers belonging to one of the Apple
- ; developer programs can submit bug reports to:
- ;
- ; devsupport@apple.com
- ;
- ;
- IF &TYPE('__QD3DVIEW__') = 'UNDEFINED' THEN
- __QD3DVIEW__ SET 1
-
- IF &TYPE('__QD3D__') = 'UNDEFINED' THEN
- include 'QD3D.a'
- ENDIF
-
- IF &TYPE('__QD3DSTYLE__') = 'UNDEFINED' THEN
- include 'QD3DStyle.a'
- ENDIF
- IF &TYPE('__QD3DSET__') = 'UNDEFINED' THEN
- include 'QD3DSet.a'
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** View Type Definitions **
- ; ** **
- ; ****************************************************************************
-
-
- ; typedef long TQ3ViewStatus
- kQ3ViewStatusDone EQU 0
- kQ3ViewStatusRetraverse EQU 1
- kQ3ViewStatusError EQU 2
- kQ3ViewStatusCancelled EQU 3
-
- ; ******************************************************************************
- ; ** **
- ; ** Default Attribute Set **
- ; ** **
- ; ****************************************************************************
-
-
- ; ******************************************************************************
- ; ** **
- ; ** View Routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3ViewObject Q3View_New(void )
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_New
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_Cancel(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_Cancel
- ENDIF
-
- ; ******************************************************************************
- ; ** **
- ; ** View Rendering routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_SetRendererByType(TQ3ViewObject view, TQ3ObjectType theType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetRendererByType
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_SetRenderer(TQ3ViewObject view, TQ3RendererObject renderer)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetRenderer
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetRenderer(TQ3ViewObject view, TQ3RendererObject *renderer)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetRenderer
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_StartRendering(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_StartRendering
- ENDIF
-
- ;
- ; extern TQ3ViewStatus Q3View_EndRendering(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_EndRendering
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_Flush(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_Flush
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_Sync(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_Sync
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** View/Bounds/Pick routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_StartBoundingBox(TQ3ViewObject view, TQ3ComputeBounds computeBounds)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_StartBoundingBox
- ENDIF
-
- ;
- ; extern TQ3ViewStatus Q3View_EndBoundingBox(TQ3ViewObject view, TQ3BoundingBox *result)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_EndBoundingBox
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_StartBoundingSphere(TQ3ViewObject view, TQ3ComputeBounds computeBounds)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_StartBoundingSphere
- ENDIF
-
- ;
- ; extern TQ3ViewStatus Q3View_EndBoundingSphere(TQ3ViewObject view, TQ3BoundingSphere *result)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_EndBoundingSphere
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_StartPicking(TQ3ViewObject view, TQ3PickObject pick)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_StartPicking
- ENDIF
-
- ;
- ; extern TQ3ViewStatus Q3View_EndPicking(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_EndPicking
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** View/Camera routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_GetCamera(TQ3ViewObject view, TQ3CameraObject *camera)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetCamera
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_SetCamera(TQ3ViewObject view, TQ3CameraObject camera)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetCamera
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** View/Lights routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_SetLightGroup(TQ3ViewObject view, TQ3GroupObject lightGroup)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetLightGroup
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetLightGroup(TQ3ViewObject view, TQ3GroupObject *lightGroup)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetLightGroup
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Idle Method **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * The idle methods allow the application to register callback routines
- ; * which will be called by the view during especially long operations.
- ; *
- ; * The idle methods may also be used to interrupt long renderings or
- ; * traversals. Inside the idler callback the application can check for
- ; * Command-Period, Control-C or clicking a "Cancel" button or whatever else
- ; * may be used to let the user interrupt rendering.
- ; *
- ; * It is NOT LEGAL to call QD3D routines inside an idler callback.
- ; *
- ; * Return kQ3Failure to cancel rendering, kQ3Success to continue. Don't
- ; * bother posting an error.
- ; *
- ; * Q3View_SetIdleMethod registers a callback that can be called
- ; * by the system during rendering. Unfortunately there is no way yet
- ; * to set timer intervals when you want to be called. Basically, it is
- ; * up to the application's idler callback to check clocks to see if you
- ; * were called back only a millisecond ago or an hour ago!
- ; *
- ; * Q3View_SetIdleProgressMethod registers a callback that also gives
- ; * progress information. This information is supplied by the renderer, and
- ; * may or may not be based on real time.
- ; *
- ; * If a renderer doesn't support the progress method, your method will be
- ; * called with current == 0 and completed == 0.
- ; *
- ; * Otherwise, you are GUARANTEED to get called at least 2 or more times:
- ; *
- ; * ONCE idleMethod(view, 0, n) -> Initialize, Show Dialog
- ; * zero or more idleMethod(view, 1..n-1, n) -> Update progress
- ; * ONCE idleMethod(view, n, n) -> Exit, Hide Dialog
- ; *
- ; * "current" is guaranteed to be less than or equal to "completed"
- ; * "completed" may change values, but current/complete always indicates
- ; * the degree of completion.
- ; *
- ; * The calling conventions aid in managing any data associated with a
- ; * progress user interface indicator.
- ;
-
- ;
- ; extern TQ3Status Q3View_SetIdleMethod(TQ3ViewObject view, TQ3ViewIdleMethod idleMethod, const void *idleData)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetIdleMethod
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_SetIdleProgressMethod(TQ3ViewObject view, TQ3ViewIdleProgressMethod idleMethod, const void *idleData)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetIdleProgressMethod
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** EndFrame Method **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; * The end frame method is an alternate way of determining when an
- ; * asynchronous renderer has completed rendering a frame. It differs from
- ; * Q3View_Sync in that notification of the frame completion is the opposite
- ; * direction.
- ; *
- ; * With Q3View_Sync the application asks a renderer to finish rendering
- ; * a frame, and blocks until the frame is complete.
- ; *
- ; * With the EndFrame method, the renderer tells the application that is has
- ; * completed a frame.
- ; *
- ; * If "Q3View_Sync" is called BEFORE this method has been called, this
- ; * method will NOT be called ever.
- ; *
- ; * If "Q3View_Sync" is called AFTER this method has been called, the
- ; * call will return immediately (as the frame has already been completed).
- ;
-
- ;
- ; extern TQ3Status Q3View_SetEndFrameMethod(TQ3ViewObject view, TQ3ViewEndFrameMethod endFrame, void *endFrameData)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetEndFrameMethod
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Push/Pop routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3Push_Submit(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Push_Submit
- ENDIF
-
- ;
- ; extern TQ3Status Q3Pop_Submit(TQ3ViewObject view)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3Pop_Submit
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Check if bounding box is visible in the viewing frustum. Transforms **
- ; ** the bbox by the current local_to_world transformation matrix and **
- ; ** does a clip test to see if it lies in the viewing frustum. **
- ; ** This can be used by applications to cull out large chunks of scenes **
- ; ** that are not going to be visible. **
- ; ** **
- ; ** The default implementation is to always return kQ3True. Renderers **
- ; ** may override this routine however to do the checking. **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Boolean Q3View_IsBoundingBoxVisible(TQ3ViewObject view, const TQ3BoundingBox *bbox)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_IsBoundingBoxVisible
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** DrawContext routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_SetDrawContext(TQ3ViewObject view, TQ3DrawContextObject drawContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetDrawContext
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetDrawContext(TQ3ViewObject view, TQ3DrawContextObject *drawContext)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetDrawContext
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Graphics State routines **
- ; ** **
- ; ** The graphics state routines can only be called while rendering (ie. in **
- ; ** between calls to start and end rendering calls). If they are called **
- ; ** outside of a rendering loop, they will return with error. **
- ; ** **
- ; ****************************************************************************
-
- ; ******************************************************************************
- ; ** **
- ; ** Transform routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_GetLocalToWorldMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetLocalToWorldMatrixState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetWorldToFrustumMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetWorldToFrustumMatrixState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetFrustumToWindowMatrixState(TQ3ViewObject view, TQ3Matrix4x4 *matrix)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetFrustumToWindowMatrixState
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Style state routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_GetBackfacingStyleState(TQ3ViewObject view, TQ3BackfacingStyle *backfacingStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetBackfacingStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetInterpolationStyleState(TQ3ViewObject view, TQ3InterpolationStyle *interpolationType)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetInterpolationStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetFillStyleState(TQ3ViewObject view, TQ3FillStyle *fillStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetFillStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetHighlightStyleState(TQ3ViewObject view, TQ3AttributeSet *highlightStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetHighlightStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetSubdivisionStyleState(TQ3ViewObject view, TQ3SubdivisionStyleData *subdivisionStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetSubdivisionStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetOrientationStyleState(TQ3ViewObject view, TQ3OrientationStyle *fontFacingDirectionStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetOrientationStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetReceiveShadowsStyleState(TQ3ViewObject view, TQ3Boolean *receives)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetReceiveShadowsStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetPickIDStyleState(TQ3ViewObject view, unsigned long *pickIDStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetPickIDStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetPickPartsStyleState(TQ3ViewObject view, TQ3PickParts *pickPartsStyle)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetPickPartsStyleState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetAntiAliasStyleState(TQ3ViewObject view, TQ3AntiAliasStyleData *antiAliasData)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetAntiAliasStyleState
- ENDIF
-
-
- ; ******************************************************************************
- ; ** **
- ; ** Attribute state routines **
- ; ** **
- ; ****************************************************************************
-
- ;
- ; extern TQ3Status Q3View_GetDefaultAttributeSet(TQ3ViewObject view, TQ3AttributeSet *attributeSet)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetDefaultAttributeSet
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_SetDefaultAttributeSet(TQ3ViewObject view, TQ3AttributeSet attributeSet)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_SetDefaultAttributeSet
- ENDIF
-
-
- ;
- ; extern TQ3Status Q3View_GetAttributeSetState(TQ3ViewObject view, TQ3AttributeSet *attributeSet)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetAttributeSetState
- ENDIF
-
- ;
- ; extern TQ3Status Q3View_GetAttributeState(TQ3ViewObject view, TQ3AttributeType attributeType, void *data)
- ;
- IF TARGET_OS_MAC ** TARGET_RT_MAC_CFM THEN
- IMPORT_CFM_FUNCTION Q3View_GetAttributeState
- ENDIF
-
-
-
- ENDIF ; __QD3DVIEW__
-
-